// 1.
Promise.resolve('Hello World')
  .then((result) => console.log(result))
  .catch((error) => console.log(error));

// 2.
new Promise((resolve, reject) => {
  resolve('success');
})
  .then((result) => console.log(result))
  .catch((error) => console.log(error));

const nameList = ['A', 'B', 'C'];
Promise.resolve(nameList).then((result) => console.log(result));

Promise.reject(new Error('rejected error')).catch((error) =>
  console.log(error)
);
